home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / security / logdaemon-2 / lib / utmpx_logout.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-31  |  545 b   |  28 lines

  1. /* Author: Wietse Venema <wietse@wzv.win.tue.nl> */
  2.  
  3. #include <sys/types.h>
  4. #include <sys/time.h>
  5. #include <utmpx.h>
  6. #include <string.h>
  7.  
  8. /* utmpx_logout - update utmp and wtmp after logout */
  9.  
  10. utmpx_logout(line)
  11. char   *line;
  12. {
  13.     struct utmpx utx;
  14.     struct utmpx *ut;
  15.  
  16.     strncpy(utx.ut_line, line, sizeof(utx.ut_line));
  17.  
  18.     if (ut = getutxline(&utx)) {
  19.     ut->ut_type = DEAD_PROCESS;
  20.     ut->ut_exit.e_termination = 0;
  21.     ut->ut_exit.e_exit = 0;
  22.     gettimeofday(&(ut->ut_tv));
  23.     pututxline(ut);
  24.     updwtmpx(WTMPX_FILE, ut);
  25.     }
  26.     endutxent();
  27. }
  28.